#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>

int main() {
    char ch[30] = { 0 };
    scanf("%s", ch);
    int sz = strlen(ch);
    int count = 0;
    while (sz > 3)
    {
        count++;
        sz -= 3;
    }
    sz = strlen(ch);
    int end1 = sz - 1;
    int end2 = sz - 1 + count;
    count = 0;
    while (end1 != end2)
    {
        if (count != 3)
        {
            ch[end2--] = ch[end1--];
            count++;
        }
        else
        {
            ch[end2--] = ',';
            count = 0;
        }
    }
    printf("%s", ch);
    return 0;
}
